let res = {
    code: null,
    message: null,
    data: null,
    ok: null,
}

function setRes(code, message, data, state, func) {
    res = {
        code: code,
        message: message,
        data: data,
        ok: state,
    }
    func(res)
    resetRes()
}

function resetRes() {
    res = null
}

export { setRes }
